package com.dealinga.shared;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Id;


public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	public Long id;
	
	public String nameFirst, nameSecond;
	
	public String email;
	//or
	public String phone;
	//or,
	public String facebook, twitter, gplus;
	
	public List<Deal> dealListVisited;

	public List<Deal> dealListLike;
	public List<Deal> dealListPay;

	private List<String> actionList;     
	
	private int countAccess; 
	private int countLogin; 
	public Date timeCreation;
	public Date timeLastVisit;
	public String accessIP,	accessHost;
	public String token; 
    
	
	// g/s automatic
	

	public void addAction(String what){
		getActionList().add(new Date() + ":" + what);
	}

	
	private List<String> getActionList(){
		if (this.actionList == null) {
			this.actionList = new ArrayList<String>();
		}
		return this.actionList;
	}
	
	public void incAccess() {
		countAccess++;
	}
	public void incLogin() {
		countLogin++;
	}
	
    
	public String lastRequest;
}
